<?php
if($_GET['phrase'])
{
header("Location: index.php?phrase=".$_GET['phrase']);
}
?>
<div id="log">
<h3>Traduction</h3>
<?php
$phrase = stripslashes(htmlentities($_POST['phrase']));

$fr = array("a", "b", "c", "d", "e", "f", "g", "h", "i", "j","k", "l", "m", "n", "o", "p", "q", "r", "s", "t","u", "v", "w", "x", "y", "z", "?", "*", "<", ">");
$weird = array("α", "в", "¢", "∂", "є", "f", "g", "н", "ι", "נ","к", "ℓ", "м", "и", "σ", "ρ", "q", "я", "ѕ", "т","υ", "ν", "ω", "χ", "у", "z", "؟", "●", "«", "»");
$haxor = array("4", "8", "(", "d", "3", "f", "9", "h", "!", "j", "k", "1", "m", "n", "0", "p", "q", "r", "5", "7", "u", "v", "w", "x", "y", "2", "?", "*", "<", ">");

function trans($from, $to, $phrase)
{
return str_ireplace($from, $to, $phrase);
}
function altern($phrase)
{
$phrase = strtolower(trim($phrase));

for($i=0;$i<strlen($phrase);$i++)
{
if($i%2 == 0)
$phrase[$i] =strtoupper($phrase[$i]);
}
return $phrase;
}

$weird = trans($fr, $weird, $phrase);
$haxor = trans($fr, $haxor, $phrase);
$alter = altern($phrase);
?>
<p>
Weird : <input type="text" size="70" value="<?php echo $weird; ?>" /><a href="#" onclick="window.clipboardData.setData('text','<?php echo $weird; ?>');">Copier le texte</a>
<br />
Haxor : <input type="text" size="70" value="<?php echo $haxor; ?>" /><a href="#" onclick="window.clipboardData.setData('text','<?php echo $haxor; ?>');">Copier le texte</a>
<br />
Alter : <input type="text" size="70" value="<?php echo $alter; ?>" /><a href="#" onclick="window.clipboardData.setData('text','<?php echo $alter; ?>');">Copier le texte</a>
</p>
</div>
